import service from "@/utils/request";
import type { Response, PageResponse } from "@/types/common";
import type { PositionItem } from "@/types/person/position";

// <any, Response<PageResponse<PositionItem>>>
// <any, Response<PositionItem>>
export const usePersonPositionPageApi = (params: object) => {
  return service<any, Response<PageResponse<PositionItem>>>({
    url: `/v1/person/position/page`,
    method: "GET",
    params,
  });
};

export const usePersonPositionQueryApi = (params: object) => {
  return service({
    url: `/v1/person/position/query`,
    method: "GET",
    params,
  });
};

export const usePersonPositionListApi = () => {
  return service({
    url: `/v1/person/position/list`,
    method: "GET",
  });
};

export const usePersonPositionCreateApi = (data: object) => {
  return service({
    url: `/v1/person/position/create`,
    method: "POST",
    data,
  });
};

export const usePersonPositionUpdateApi = (data: object) => {
  return service({
    url: `/v1/person/position/update`,
    method: "POST",
    data,
  });
};

export const usePersonPositionDeleteApi = (data: object) => {
  return service({
    url: `/v1/person/position/delete`,
    method: "DELETE",
    data,
  });
};
